package com.gears_software.bbnetwork.activitys;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.ViewById;
import org.androidannotations.annotations.WindowFeature;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.Window;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.gears_software.bbnetwork.R;

@SuppressLint("SetJavaScriptEnabled")
@EActivity(R.layout.activity_showweb)
@WindowFeature(Window.FEATURE_NO_TITLE)
public class ShowWebViewActivity extends Activity {

	@ViewById
	WebView show_webview;

	@AfterViews
	void onCreate() {
		String url = getIntent().getStringExtra("url");
		WebSettings webSettings = show_webview.getSettings(); 
		// 设置WebView属性，能够执行Javascript脚本
		webSettings.setJavaScriptEnabled(true);
		// 设置可以访问文件
		webSettings.setAllowFileAccess(true);
		// 设置支持缩放
		webSettings.setBuiltInZoomControls(true);
		// 加载需要显示的网页
		show_webview.loadUrl(url);
	}

	@Click
	void tixian_back() {
		finish();
	}
}
